package com.qbccn.oauth2service.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author linke
 * @date 2020-03-14 下午 16:14
 * @description
 */
@FeignClient(value = "oauth2-service", path = "oauth")
public interface OauthServiceFeign {
    /**
     * 登陆
     */
    @PostMapping(value = "token")
    String login(@RequestParam("username") String username, @RequestParam("password") String password,
                 @RequestParam("grant_type") String grant_type, @RequestParam("client_id") String client_id,
                 @RequestParam("client_secret") String client_secret);

    /**
     * 刷新令牌
     */
    @PostMapping("token")
    String refreshToken(@RequestParam("token") String token,
                        @RequestParam("grant_type") String grant_type, @RequestParam("client_id") String client_id,
                        @RequestParam("client_secret") String client_secret);
}
